"""
    1. 对图像进行上采样
        cv.pyrUp(img)
    2. 对图像进行下采样
        cv.pyrDown(img)
"""
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt

# 1. 读取图像
img = cv.imread("image/img.png")

# 2. 进行图像采样
up_img = cv.pyrUp(img)  # 上采样
img_1 = cv.pyrDown(img)  # 下采样

# 3. 图像展示
cv.imshow("enlarge", up_img)
cv.imshow("original", img)
cv.imshow("shrink", img_1)
cv.waitKey(0)
cv.destroyAllWindows()


